﻿@model MVC4CodeSamples.Models.Entities.Product

@{
    ViewBag.Title = "Edit";
}

<h2>Edit</h2>

@using (Html.BeginForm()) {
    @Html.ValidationSummary(true)

    <fieldset>
        <legend>Product</legend>

        @Html.HiddenFor(model => model.ProductID)

        <div class="editor-label">
            @Html.LabelFor(model => model.Name)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Name)
            @Html.ValidationMessageFor(model => model.Name)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.ProductNumber)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.ProductNumber)
            @Html.ValidationMessageFor(model => model.ProductNumber)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Color)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Color)
            @Html.ValidationMessageFor(model => model.Color)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.StandardCost)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.StandardCost)
            @Html.ValidationMessageFor(model => model.StandardCost)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.ListPrice)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.ListPrice)
            @Html.ValidationMessageFor(model => model.ListPrice)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Size)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Size)
            @Html.ValidationMessageFor(model => model.Size)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Weight)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Weight)
            @Html.ValidationMessageFor(model => model.Weight)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.ProductCategoryID, "ProductCategory")
        </div>
        <div class="editor-field">
            @Html.DropDownList("ProductCategoryID", String.Empty)
            @Html.ValidationMessageFor(model => model.ProductCategoryID)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.ProductModelID, "ProductModel")
        </div>
        <div class="editor-field">
            @Html.DropDownList("ProductModelID", String.Empty)
            @Html.ValidationMessageFor(model => model.ProductModelID)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.SellStartDate)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.SellStartDate)
            @Html.ValidationMessageFor(model => model.SellStartDate)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.SellEndDate)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.SellEndDate)
            @Html.ValidationMessageFor(model => model.SellEndDate)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.DiscontinuedDate)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.DiscontinuedDate)
            @Html.ValidationMessageFor(model => model.DiscontinuedDate)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.ThumbnailPhotoFileName)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.ThumbnailPhotoFileName)
            @Html.ValidationMessageFor(model => model.ThumbnailPhotoFileName)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.rowguid)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.rowguid)
            @Html.ValidationMessageFor(model => model.rowguid)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.ModifiedDate)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.ModifiedDate)
            @Html.ValidationMessageFor(model => model.ModifiedDate)
        </div>

        <p>
            <input type="submit" value="Save" />
        </p>
    </fieldset>
}

<div>
    @Html.ActionLink("Back to List", "Index")
</div>

@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}
